
<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.io.PrintWriter"%>
<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8"%>

<!doctype html>
<html class="no-js">
<head>
<%@ include file="./commoms/link.txt"%>
<meta name="description" content="userinfo">
<style type="text/css">
label {
	font-family: sans-serif;
}

div[name] {
	padding: 20px, 10px, 10px, 20px;
}

h2 {
	margin: 10px;
	padding: 10px;
	font-family: sans-serif;
	background-color: #F0FFFF;
}

#birthday {
	background-color: #FFFFFF;
	cursor: pointer;
}
</style>
</head>
<body>
	<%@ include file="./commoms/userHeader.txt"%>

	<div class="admin-content">
		<div class="am-cf am-padding">
			<div class="am-fl am-cf">
				<strong class="am-text-primary am-text-lg">添加设备</strong>
			</div>
		</div>

		<hr />

		<div class="am-g">
			

			<div class="am-u-sm-12 am-u-md-8 ">
				<form class="am-form am-form-horizontal" action='api/device/insertdevice.do'
					id="inserdevice" data-am-validator method="post">
					<div id="baseInfo">
						<h2>基本信息</h2>
						<div class="am-form-group">
							<label for="devicename" class="am-u-lg-3 am-form-label">设备名</label>
							<div class="am-u-lg-9">
								<input type="text" id="devicename" placeholder="设备名"
									name="devicename" required data-foolish-msg="请输入设备名以方便您以后查找" >
							</div>
						</div>

						
							
						<div class="am-form-group">
							<label for="devicecode" class="am-u-lg-3 am-form-label">设备编码</label>
							<div class="am-u-lg-9">
								<input type="text" id="devicecode" placeholder="设备编码" name="devicecode" maxlength="10">
							</div>
						</div>
						

	                       <div class="am-form-group">
							<label for="holder" class="am-u-lg-3 am-form-label">持有人姓名</label>
							<div class="am-u-lg-9">
								<input type="text" id="holder" placeholder="持有人姓名" name="holder" maxlength="4">
							</div>
						</div>
	                   
					
					</div>




					<div id="EnterpriseContactInformation">
					

						
						


						<div class="am-form-group">
							<div class="am-u-lg-9 am-u-sm-push-3">
								<button id="submit" class="am-btn am-btn-primary">增加设备</button>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>

	</div>

	<a href="#"
		class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
<script src="assets/js/pagejs/userinfo.js"></script>
	<script type="text/javascript">

	    
	
		
		var $form = $('#inserdevice');
		setFormValidate($form,function(data) {
		
			
    		if(data.code=='200')
			{
		window.location.href = 'devicemanager.jsp';
			}
    		
    		
		if(data.code=='406')
		{
	myAlert('提示', '填写的信息有误请检查之后再提交');
		}
		if(data.code=='403')
		{
			myAlert('提示', '重新登陆',function(){window.location.href = domain+'/Login.jsp';});
		}
	});
	
		$("form").submit(function(e){
	
		 return false;
			});
	
		
		
	</script>
</body>
</html>
